package com.detech.sboh.base.hibernate.user.entity;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "tb_sys_logininfor")
public class TbSysLogininfor {
    private long infoId;
    private String username;
    private String ipaddr;
    private String status;
    private String msg;
    private Date accessTime;
    private String deviceType;

    @Id
    @Column(name = "info_id")
    public long getInfoId() {
        return infoId;
    }

    public void setInfoId(long infoId) {
        this.infoId = infoId;
    }

    @Basic
    @Column(name = "username")
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Basic
    @Column(name = "ipaddr")
    public String getIpaddr() {
        return ipaddr;
    }

    public void setIpaddr(String ipaddr) {
        this.ipaddr = ipaddr;
    }

    @Basic
    @Column(name = "status")
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    @Basic
    @Column(name = "msg")
    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Basic
    @Column(name = "access_time")
    public Date getAccessTime() {
        return accessTime;
    }

    public void setAccessTime(Date accessTime) {
        this.accessTime = accessTime;
    }

    @Basic
    @Column(name = "device_type")
    public String getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(String deviceType) {
        this.deviceType = deviceType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbSysLogininfor that = (TbSysLogininfor) o;
        return infoId == that.infoId &&
                Objects.equals(username, that.username) &&
                Objects.equals(ipaddr, that.ipaddr) &&
                Objects.equals(status, that.status) &&
                Objects.equals(msg, that.msg) &&
                Objects.equals(accessTime, that.accessTime) &&
                Objects.equals(deviceType, that.deviceType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(infoId, username, ipaddr, status, msg, accessTime, deviceType);
    }
}
